package com.projet.blocs;

import com.projet.blocs.obstacles.Cote;
import com.projet.labyrinth.Bille;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.RectF;

public abstract class Bloc extends RectF{
	
	private Bitmap sprite;
	protected int _x, _y;
	protected int _tailleBloc;
	
	public Bloc(int tailleBloc, int x, int y, Resources res, int idSprite) {
		super(x * tailleBloc, y * tailleBloc, x * tailleBloc + tailleBloc, y * tailleBloc + tailleBloc);
		_x = x;
		_y = y;
		sprite = BitmapFactory.decodeResource(res, idSprite);
		_tailleBloc = tailleBloc;
	}
	
	public int GetX() {
		return _x;
	}
	
	public int GetY() {
		return _y;
	}
	
	public void CollisionExterieure(Bille bille, Cote coteTouche) {
	}
	
	public void CollisionInterieure(Bille bille) {
	}
	
	public void Dessiner(Canvas pCanvas) {
		pCanvas.drawBitmap(sprite, null, this, null);
	}
}
